package com.ruoyi.biz.service.impl;

import java.util.List;

import com.ruoyi.biz.domain.PersonalInfo;
import com.ruoyi.biz.mapper.PersonalInfoMapper;
import com.ruoyi.biz.service.IPersonalInfoService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 入住人员信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-10
 */
@Service
public class PersonalInfoServiceImpl implements IPersonalInfoService
{
    @Autowired
    private PersonalInfoMapper personalInfoMapper;

    /**
     * 查询入住人员信息
     * 
     * @param personalId 入住人员信息主键
     * @return 入住人员信息
     */
    @Override
    public PersonalInfo selectPersonalInfoByPersonalId(Long personalId)
    {
        return personalInfoMapper.selectPersonalInfoByPersonalId(personalId);
    }

    /**
     * 查询入住人员信息列表
     * 
     * @param personalInfo 入住人员信息
     * @return 入住人员信息
     */
    @Override
    public List<PersonalInfo> selectPersonalInfoList(PersonalInfo personalInfo)
    {
        return personalInfoMapper.selectPersonalInfoList(personalInfo);
    }

    /**
     * 新增入住人员信息
     * 
     * @param personalInfo 入住人员信息
     * @return 结果
     */
    @Override
    public int insertPersonalInfo(PersonalInfo personalInfo)
    {
        personalInfo.setCreateTime(DateUtils.getNowDate());
        return personalInfoMapper.insertPersonalInfo(personalInfo);
    }

    /**
     * 修改入住人员信息
     * 
     * @param personalInfo 入住人员信息
     * @return 结果
     */
    @Override
    public int updatePersonalInfo(PersonalInfo personalInfo)
    {
        personalInfo.setUpdateTime(DateUtils.getNowDate());
        return personalInfoMapper.updatePersonalInfo(personalInfo);
    }

    /**
     * 批量删除入住人员信息
     * 
     * @param personalIds 需要删除的入住人员信息主键
     * @return 结果
     */
    @Override
    public int deletePersonalInfoByPersonalIds(Long[] personalIds)
    {
        return personalInfoMapper.deletePersonalInfoByPersonalIds(personalIds);
    }

    /**
     * 删除入住人员信息信息
     * 
     * @param personalId 入住人员信息主键
     * @return 结果
     */
    @Override
    public int deletePersonalInfoByPersonalId(Long personalId)
    {
        return personalInfoMapper.deletePersonalInfoByPersonalId(personalId);
    }
}
